home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Mac OS / Display Manager SDK / Sample Code / DMFkey Source / RequestVideo.h < prev   
Encoding:
C/C++ Source or Header  |  1999-01-20  |  3.1 KB  |  79 lines  |  [TEXT/MMCC]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    MacOS™ Sample Code
  4. #    
  5. #    Written by: Eric Anderson
  6. #     email: eric3@apple,com
  7. #
  8. #    Display Manager sample code
  9. #
  10. #    RequestVideo
  11. #
  12. #    RequestVideo.h    -    C Header
  13. #
  14. #    Copyright © 1995 Apple Computer, Inc.
  15. #    All rights reserved.
  16. #
  17. #    Revision History:
  18. #
  19. #    1/17/99        ewa        Updated comments
  20. #    5/31/95        ewa        Added RVGetCurrentVideoSetting and RVConfirmVideoRequest routines
  21. #                        to make it easy to revert back to where you came from and to give
  22. #                        the user a chance to confirm the new setting if the new mode was
  23. #                        valid (ie: the card supports it) but not safe (the monitor may not).
  24. #    5/24/95        ewa        Give the kAllValidModesBit requestFlags option for safe only or all
  25. #                        valid resolution timings.
  26. #
  27. #
  28. #
  29. #    Components:    PlayVideo.c            
  30. #                RequestVideo.c        
  31. #                RequestVideo.h        
  32. #                RequestVideo.rsrc        
  33. #
  34. #    For information on the use of this sample code, please the documentation in the Read Me file
  35. ------------------------------------------------------------------------------*/
  36.  
  37. #include <QuickDraw.h>
  38. #include <Video.h>
  39.  
  40. // requestFlags bit values in VideoRequestRec (example use: 1<<kAbsoluteRequestBit)
  41. enum {
  42.     kBitDepthPriorityBit        = 0,    // Bit depth setting has priority over resolution
  43.     kAbsoluteRequestBit            = 1,    // Available setting must match request
  44.     kShallowDepthBit            = 2,    // Match bit depth less than or equal to request
  45.     kMaximizeResBit                = 3,    // Match screen resolution greater than or equal to request
  46.     kAllValidModesBit            = 4        // Match display with valid timing modes (may include modes which are not marked as safe)
  47. };
  48.  
  49. // availFlags bit values in VideoRequestRec (example use: 1<<kModeValidNotSafeBit)
  50. enum {
  51.     kModeValidNotSafeBit        = 0        //  Available timing mode is valid but not safe (requires user confirmation of switch)
  52. };
  53.  
  54. // video request structure
  55. struct VideoRequestRec    {
  56.     GDHandle        screenDevice;        // <in/out>    nil will force search of best device, otherwise search this device only
  57.     short            reqBitDepth;        // <in>        requested bit depth
  58.     short            availBitDepth;        // <out>    available bit depth
  59.     unsigned long    reqHorizontal;        // <in>        requested horizontal resolution
  60.     unsigned long    reqVertical;        // <in>        requested vertical resolution
  61.     unsigned long    availHorizontal;    // <out>    available horizontal resolution
  62.     unsigned long    availVertical;        // <out>    available vertical resolution
  63.     unsigned long    requestFlags;        // <in>        request flags
  64.     unsigned long    availFlags;            // <out>    available mode flags
  65.     unsigned long    displayMode;        // <out>    mode used to set the screen resolution
  66.     unsigned long    depthMode;            // <out>    mode used to set the depth
  67.     VDSwitchInfoRec    switchInfo;            // <out>    DM2.0 uses this rather than displayMode/depthMode combo
  68. };
  69. typedef struct VideoRequestRec VideoRequestRec;
  70. typedef struct VideoRequestRec *VideoRequestRecPtr;
  71.  
  72. // Routine defines
  73. OSErr RVRequestVideoSetting(VideoRequestRecPtr requestRecPtr);
  74. OSErr RVGetCurrentVideoSetting(VideoRequestRecPtr requestRecPtr);
  75. OSErr RVSetVideoRequest (VideoRequestRecPtr requestRecPtr);
  76. OSErr RVConfirmVideoRequest (VideoRequestRecPtr requestRecPtr);
  77. OSErr RVSetVideoAsScreenPrefs (void);
  78.  
  79.